<template>
  <div class="count">
    <h3>当前数字: {{ count }}</h3>
    <el-button type="primary" @click="addOne">加1</el-button>
    <el-button type="primary" @click="subOne">减1</el-button>
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useCountStore } from '@/store/count'
const store = useCountStore()
const count = computed(() => store.count)
const addOne = () => {
  store.count++
}
const subOne = () => {
  store.count--
}
</script>
